package com.htjx.mall.commons.utils;

import org.apache.commons.lang3.RandomStringUtils;

/**
 * 随机数生成器
 * 
 * @author jingrenlang
 * 
 */
public final class Randoms {

	private static final String NUMBER = "0123456789";
	private static final String LETTER = "abcdefghijklmnopqrstuvwxyz";

	/**
	 * 随机指定长度的数字字符串
	 */
	public final static String randomNumber(int len) {
		return RandomStringUtils.random(len, NUMBER);
	}

	/**
	 * 随机密码：数字+小写字母
	 */
	public final static String randomPassword(int len) {
		return RandomStringUtils.random(len, NUMBER + LETTER);
	}

	/**
	 * 随机密码：数字+小写字母+大写字母
	 */
	public final static String randomComplex(int len) {
		return RandomStringUtils.random(len, true, true);
	}

}
